<template>
  <el-card shadow="have">
    <div slot="header">
      <span>市场占有量详情</span>
    </div>
    <div>
      <el-form inline :form="form">
        <el-form-item label="教材名/ISBN">
          <el-input v-model="form.search_key" type="text" placeholder="请输入教材名/ISBN" />
        </el-form-item>
        <el-form-item label="省份">
          <el-select v-model="form.search_area">
            <el-option v-for="item in areaList(1)" :key="item.id" :value="item.value" :label="item.name" />
          </el-select>
        </el-form-item>
        <el-form-item label="学校级别">
          <el-select v-model="form.search_area">
            <el-option v-for="item in areaList(1)" :key="item.id" :value="item.value" :label="item.name" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary">搜索</el-button>
        </el-form-item>
      </el-form>

      <el-divider />

      <el-table border :data="tableData">
        <el-table-column prop="school_name" label="学校名称" />
        <el-table-column prop="variety" label="本版品种" />
        <el-table-column prop="all_variety" label="总品种" />
        <el-table-column prop="variety_prop" label="品种占比" />
        <el-table-column prop="choose" label="本版选用量" />
        <el-table-column prop="all_choose" label="总选用量" />
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button type="text">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="1"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      />
    </div>
  </el-card>
</template>

<script>
export default {
  name: 'BazaarHaveTable',
  props: {
    areaList: {
      type: Function,
      default() {
        return function() {}
      }
    }
  },
  data() {
    return {
      form: {
        search_key: '',
        search_area: ''
      },
      tableData: [
        { school_name: '西北大学软件职业技术学院', variety: 1312, all_variety: 321, variety_prop: 53, choose: 132, all_choose: 213 },
        { school_name: '西北大学软件职业技术学院', variety: 1312, all_variety: 321, variety_prop: 53, choose: 132, all_choose: 213 },
        { school_name: '西北大学软件职业技术学院', variety: 1312, all_variety: 321, variety_prop: 53, choose: 132, all_choose: 213 },
        { school_name: '西北大学软件职业技术学院', variety: 1312, all_variety: 321, variety_prop: 53, choose: 132, all_choose: 213 }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
